from django.db import models


# Create your models here.
class Area(models.Model):
    name = models.CharField(max_length=20, verbose_name='name')
    parent = models.ForeignKey('self', on_delete=models.SET_NULL, related_name='subs',
                               blank=True, null=True, verbose_name='pid')

    class Meta:
        db_table = 'tb_areas'
        verbose_name = 'area'
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.name
